
const { ccclass, property } = cc._decorator;

@ccclass
export default class StartScene extends cc.Component {
    @property(cc.Button)
    public playbtn:cc.Button=null;
   
    start () {      
        console.log(1111) ;                                      // onPlayClick里面的this 也能用了
        this.playbtn.node.on('click',this.onPlayClick.bind(this)); //最后的this值传递下去 
        //this.playbtn.node.on('click',this.onPlayClick,this); 
    }

    public onPlayClick(Button)
    {
        console.log('button name:', Button.name)
   
        cc.director.loadScene('Gamescene1');
    }

    
}


